void quicksort(int A[],int low,int high)
{
    printf("%d %d\n",low,high);
    if(low>=high)   return;

    int temp,left=low,right=high;
    temp=A[low];
    while(low<high)
    {
        while(low<high && A[high]>=temp)    high--;
        A[low]=A[high];
        while(low<high && A[low]<=temp)     low++;
        A[high]=A[low];

        //printf("%d %d\n",low,high);
    }
    A[low]=temp;
    quicksort(A,left,low-1);
    quicksort(A,low+1,right);
}

int main()
{
    int A[100];
    int n,cnt=0;
    while(scanf("%d",&n) && (char)n!='#' && cnt<100)
    {
        A[cnt++]=n; //此时可以理解为cnt的值为要存储的数的下标
    }

    quicksort(A,0,cnt-1);

    int i;
    for(i=0;i<cnt;i++)  printf("%d ",A[i]);
}
